package chetan.CameraAndVideo;

import chetan.CameraAndVideo.R;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;


public class Tabber extends TabActivity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		Resources res = getResources(); // Resource object to get Drawables
		TabHost tabHost = getTabHost();  // The activity TabHost
		TabHost.TabSpec spec;  // Reusable TabSpec for each tab
		Intent intent;  // Reusable Intent for each tab		

		// Initialize a TabSpec for each tab and add it to the TabHost
		intent = new Intent().setClass(this, VideoActivity.class);
		spec = tabHost.newTabSpec("Video").setIndicator("Video",
				res.getDrawable(R.drawable.ic_tab_video))
				.setContent(intent);
		tabHost.addTab(spec);
		
		//camera preview
		intent = new Intent().setClass(this,CameraActivity.class);
		spec = tabHost.newTabSpec("Camera").setIndicator("Camera",
				res.getDrawable(R.drawable.ic_tab_camera))
				.setContent(intent);
		tabHost.addTab(spec);
		tabHost.setCurrentTab(1);
	}
	
}